UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4WiQS4ZQTBObcBPdXm9yGtdASa361oGMxvUzH609Pc0=' 
WHERE 
  key_id = 'a9d8dc990c6cdc4345ba36479a86919d738ba57f44760b25a9b0e46ac09478da' 
  AND (
    token = '4WiQS4ZQTBObcBPdXm9yGtdASa361oGMxvUzH609Pc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025