UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pLjqIluAeN7QkptU8mjGqAre6MuuThHimbR0rE9FtIU='
WHERE
key_id = 'de1a8e42097aceb9e976f2bd7e01e56100de6d1b64b75e64f48298a1dd6395d7'
AND (
token = 'pLjqIluAeN7QkptU8mjGqAre6MuuThHimbR0rE9FtIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)