UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'selhzb0DUjUJk8+xfbk3hJjAkjeFC1RRr83HFG1F+bU='
WHERE
key_id = 'd1db500f1c22cd127eacf0d3284dfbc3d4383a5cce54a1645d7e69fb3d2ebbc7'
AND (
token = 'selhzb0DUjUJk8+xfbk3hJjAkjeFC1RRr83HFG1F+bU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)