UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ccyPJt1feoHKawyQH5F1W+txxUiXczvrvhn8DzaYjMM='
WHERE
key_id = 'deb15610affb8c71284d3e94d506a541ecab39daad10283a9320c27f6267f945'
AND (
token = 'ccyPJt1feoHKawyQH5F1W+txxUiXczvrvhn8DzaYjMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)