UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W2Dux7zmHPHab2/3ntJ6tjLQbVIzRiJACwHDc2XVUm0=' 
WHERE 
  key_id = '0a46e0736969fa216afe04f5a3c3896eb63fca2c5b9f5aa5a9d18a98abed272c' 
  AND (
    token = 'W2Dux7zmHPHab2/3ntJ6tjLQbVIzRiJACwHDc2XVUm0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036