UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zonVXcJVxXAl8AV08iuFYwnQEjxnCg33tsyXIYpqssc='
WHERE
key_id = '34dfd2dda3206e2c0d217e17b19796ab8254fc0eb219dcb4d1e6613b82836da8'
AND (
token = 'zonVXcJVxXAl8AV08iuFYwnQEjxnCg33tsyXIYpqssc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)