UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rnwrIo192BDTtmEpdxruilvz5apN30X2BpQUeR5d9eA=' 
WHERE 
  key_id = '32e766eb3d1f83563ff06b323ddd52c3ff39549313e64dce09c988df8bcdb090' 
  AND (
    token = 'rnwrIo192BDTtmEpdxruilvz5apN30X2BpQUeR5d9eA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041