UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvCMmuYV7oTO3ldk0xe1j0LnouzLATe8xGiuVNxv4GY=' 
WHERE 
  key_id = '19b07c03ad21de23cae6b7e46052771139feb3393dd067dc9732f3a97f560d23' 
  AND (
    token = 'dvCMmuYV7oTO3ldk0xe1j0LnouzLATe8xGiuVNxv4GY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016