UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3XT/08Kl8Eq55vnAbUcLLm3fVXG99gKerU32Esk7FJM='
WHERE
key_id = '86df4be6e16d10b06168e79f12333538293cbb341b1465b05abea4c637c57f17'
AND (
token = '3XT/08Kl8Eq55vnAbUcLLm3fVXG99gKerU32Esk7FJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)