UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u4z5B4DMQZKAewCATB1CTlWEp/r/6SjgfRtIL0eUfoE='
WHERE
key_id = '24884af869758b4c6577345b2735ff0e3da8f78c963c4933de0eadcc2cfd4e71'
AND (
token = 'u4z5B4DMQZKAewCATB1CTlWEp/r/6SjgfRtIL0eUfoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)