UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SCkyu83P/z6N4fTlW1ZKZkfgkzu2SIUJtMZ5TLndcf0=' 
WHERE 
  key_id = '115bb0dd7fd974b3644f5b1c86232926266cb93f3732d24760d4155db2d21175' 
  AND (
    token = 'SCkyu83P/z6N4fTlW1ZKZkfgkzu2SIUJtMZ5TLndcf0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051