UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2UZztJ4Tl843GWH9jHLg+uQg5ILGwARaHY3Q9759DrM='
WHERE
key_id = '4acf8b5a1c993b80a3264bc1a2ecb983757b809eb1b63d3bacd82a19c4d8e525'
AND (
token = '2UZztJ4Tl843GWH9jHLg+uQg5ILGwARaHY3Q9759DrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)