UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/o00jVb2wC+B/dokhbGVkADzhZkG0Pfu3ky6waSAySw='
WHERE
key_id = '20fad9304421bd73fd4afbb7df676bf8b553ea9e43a7dd10b8cdf7286c29d3f5'
AND (
token = '/o00jVb2wC+B/dokhbGVkADzhZkG0Pfu3ky6waSAySw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)