UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jVzWx7rL0ZX7WWwIb7TOpItfTCBCzSzMD9bJqZoEuiY=' 
WHERE 
  key_id = '028dcf128b111c400440fe691ec8dfc40185ac6e537f1f91981cf938bbe18fb7' 
  AND (
    token = 'jVzWx7rL0ZX7WWwIb7TOpItfTCBCzSzMD9bJqZoEuiY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036