UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TsrqKGQRHqLZGFhdBUxbsr9Km3mhc2CKoHqyyH84WDA='
WHERE
key_id = '097039cfaecf598f7cd142ed3b28673251257893d84fb503913765ab9db900c1'
AND (
token = 'TsrqKGQRHqLZGFhdBUxbsr9Km3mhc2CKoHqyyH84WDA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)