UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EPIntSpwaLnz6aI8NEl0B4rUfIvUa93nnBTfeBjtS0M=' 
WHERE 
  key_id = '64063bd193bd16e6430e23deb746125e792ffe56a15d1f9fee7caaaa40492c84' 
  AND (
    token = 'EPIntSpwaLnz6aI8NEl0B4rUfIvUa93nnBTfeBjtS0M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026