UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YK/NIYiDJnLyc5c2B8myqXLxQLhWPESMDNPFoyJyHGw=' 
WHERE 
  key_id = 'ce9713712729c93312cdaa684d51246f419f8dc63818a3076f17b6a291a88a1a' 
  AND (
    token = 'YK/NIYiDJnLyc5c2B8myqXLxQLhWPESMDNPFoyJyHGw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016