UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i2swbfVBnvZzveJ3jQqlM462RveT5pDIhWy/hUQBjzE='
WHERE
key_id = '3df6c2a1166f4f827a1dd6ffd31c6020c7e545ff53a2134626ced15dabb9f20e'
AND (
token = 'i2swbfVBnvZzveJ3jQqlM462RveT5pDIhWy/hUQBjzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)