UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PcOYR+/AHKeTeXbJ5q2/RCxgdKh+rXT+8TveuT67LvI='
WHERE
key_id = '1a821e8bd820b02f38f9fef78e65601d9d5cfb6b2a04df086e720394e88bc3a5'
AND (
token = 'PcOYR+/AHKeTeXbJ5q2/RCxgdKh+rXT+8TveuT67LvI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)