UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HcD1kU5hk/gLl4Qz0HXR7JsE+uKtQ5tGHUvCWSQX/q4=' 
WHERE 
  key_id = '7f50452ac1d2fc2a631f98fee8ec9881600735ed8e7b37b54a30318e54ae8fef' 
  AND (
    token = 'HcD1kU5hk/gLl4Qz0HXR7JsE+uKtQ5tGHUvCWSQX/q4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020