UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ITpI4Nxpk96dJxcetBhTws+jC6pGc5qZ+JFiUOJkK4='
WHERE
key_id = '64fe5f6313cc02ffca786fd30edae533a57a9662c4693e65725f08ca196628a3'
AND (
token = '6ITpI4Nxpk96dJxcetBhTws+jC6pGc5qZ+JFiUOJkK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)