UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+PxhXB0EWX+AR9dWHq6Bjf/4bd0WLHHSmbT2hlJqsrM='
WHERE
key_id = '7cca312f306d54da4d3eba7d5c99ddc82c27a4d48b6fe44a5127451fad960ce6'
AND (
token = '+PxhXB0EWX+AR9dWHq6Bjf/4bd0WLHHSmbT2hlJqsrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)