UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3uBRnpiaIig59EGrGzvvm8i1m9gEbaY3gXKkV1xy7yA=' 
WHERE 
  key_id = 'fde54c2309c3e5b8cc52667bfb83b4ccfbb95704e0d04c42f02631119492374b' 
  AND (
    token = '3uBRnpiaIig59EGrGzvvm8i1m9gEbaY3gXKkV1xy7yA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034