UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/OKWbHAh7yMzVV4dy5bCZjvhQcjoVKIVt/3dvx9eVIw='
WHERE
key_id = '3abb2511cea35623881a6da893926993cd9cbb4afdb75dbd39b5ead226cf9fb9'
AND (
token = '/OKWbHAh7yMzVV4dy5bCZjvhQcjoVKIVt/3dvx9eVIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)