UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z3PAQdgWD5eEVmsXN3Mmm2lt5liVgSLZiEbWagR4zpo='
WHERE
key_id = '499445d01a0a29dc0562eebc32f498827ebd7626ef66355ca0563d1774bcb66e'
AND (
token = 'z3PAQdgWD5eEVmsXN3Mmm2lt5liVgSLZiEbWagR4zpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)