UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mrqLxTsld3Q6rZIHo/AwSCB0lchtBBjtJ3KExhxc8TM=' 
WHERE 
  key_id = '20fbbd9f4a2e35201a94a96b5c827a07626e7034c57349fc9efeb6d8dd7684aa' 
  AND (
    token = 'mrqLxTsld3Q6rZIHo/AwSCB0lchtBBjtJ3KExhxc8TM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026