UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pcS+xi7bCjcn/Jj90SUFxDA/296V1WbfHGpzcpWMtLs='
WHERE
key_id = '3f9568fd9a03b709f96fcf7e9a08f83a097a0933ae26a30fab915115d263809b'
AND (
token = 'pcS+xi7bCjcn/Jj90SUFxDA/296V1WbfHGpzcpWMtLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)