UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Ke/1U2yvBTgnGSsDjLgyEMJmjV+bzkNZ+ZYoKU9WvU='
WHERE
key_id = 'f63dc093f12b0d7c0f1555d5e9f5987a1f0f284a42c1c4b3adab757260311fbf'
AND (
token = '4Ke/1U2yvBTgnGSsDjLgyEMJmjV+bzkNZ+ZYoKU9WvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)