UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ViMu+enb/2P8yUI4mTiCXfmdPYAlW0zhHZWfk0oe2uQ=' 
WHERE 
  key_id = '57b28d14b8b071549ac8340834361f293033c4392b14c6e7fd41845bfae9468d' 
  AND (
    token = 'ViMu+enb/2P8yUI4mTiCXfmdPYAlW0zhHZWfk0oe2uQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025