UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LEgPEqNi5AJxmYG9OElYhXT40X5ni+cDzDtkcFnnMYk=' 
WHERE 
  key_id = '5b185a8697bab6e402525310ea6a1b0f311c49b0f735d5cdd7233993c1293232' 
  AND (
    token = 'LEgPEqNi5AJxmYG9OElYhXT40X5ni+cDzDtkcFnnMYk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00395