UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'unP2puT3H0hKHQknKHhtEGtLE1H80Gjsjb6tTx3hu4s=' 
WHERE 
  key_id = '44fe62098d09d96fecab9c4e33509550c5c0b05b15278080fece1a026c3882c7' 
  AND (
    token = 'unP2puT3H0hKHQknKHhtEGtLE1H80Gjsjb6tTx3hu4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039