UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5AbmM1KAT9YKvFUmxxeAVQemucXlwjqBnCqmPxBRjZI=' 
WHERE 
  key_id = 'aebb5a05f471d6cfa24e1d138dd53904624d75b93443eb0609729fb41e6c6aee' 
  AND (
    token = '5AbmM1KAT9YKvFUmxxeAVQemucXlwjqBnCqmPxBRjZI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054