UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JZVPaJJdUng74G3Z8eEJlZdf/3IeBUgmq0c5SIpW39Q='
WHERE
key_id = '9c800d588a1decce678652913e09fe79db75349b610e68ac5a93a4f9f3e36eda'
AND (
token = 'JZVPaJJdUng74G3Z8eEJlZdf/3IeBUgmq0c5SIpW39Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)