UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOAgQA9EQ+Z7qRaY8deemlI889f7YxWSFBUHaSXeFp0='
WHERE
key_id = 'b220d7a5e551292a4674fef6c4d34746e353da66112567436dc7eda66bb86524'
AND (
token = 'lOAgQA9EQ+Z7qRaY8deemlI889f7YxWSFBUHaSXeFp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)