UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'om7IZPDpEDAUELJOA8SEWEcEu2h/qI4MqabSNhshFDU=' 
WHERE 
  key_id = '958a764d47e5b1588ccc1eacab29384d7756a638211bdf9312ebd385b68d69b5' 
  AND (
    token = 'om7IZPDpEDAUELJOA8SEWEcEu2h/qI4MqabSNhshFDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024