UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jgPm4NPkk/Hsu53mLHeAdLlXeOraaoUcuePMQ/qB3X4='
WHERE
key_id = '9a2ca7d7105c499eac3bef9e6cfcb2df305e2e02717517a442b5d36d767dcee4'
AND (
token = 'jgPm4NPkk/Hsu53mLHeAdLlXeOraaoUcuePMQ/qB3X4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)