UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Po1+NtbFWAQVkZ/QxkuQnLwo6FQW5vaT5MIb3bXNbqE=' 
WHERE 
  key_id = '4dfa4118f47a2420fd959189dcd10ca786c7384102be9d3e1c313a39c724a144' 
  AND (
    token = 'Po1+NtbFWAQVkZ/QxkuQnLwo6FQW5vaT5MIb3bXNbqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031