UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9wD6IyMSERqu5gf5FAG1+zipC4PZP/Eyk27PzedXSyc=' 
WHERE 
  key_id = 'c707579fdfbfe2d8a08dadb173bde1b81dd17375f1790107b0a89e4210919ae3' 
  AND (
    token = '9wD6IyMSERqu5gf5FAG1+zipC4PZP/Eyk27PzedXSyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028