UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j7CRqvJICDFMQU/MV1Ut/YfED6G6TfLDuRZGLxfMCxA='
WHERE
key_id = '197cf5909dd2a0dde3419ce27d827079afee182c280bed0a4cc3761fa54540c8'
AND (
token = 'j7CRqvJICDFMQU/MV1Ut/YfED6G6TfLDuRZGLxfMCxA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)