UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O0Yh6QsuMN2zfR9A4SAIkMd8qx3PGN3ro2TRNvBht+k='
WHERE
key_id = 'd41a5d56fe06d97dcc7846a4e3be26ecf675bd599c816d2b915f0b9db3c974e6'
AND (
token = 'O0Yh6QsuMN2zfR9A4SAIkMd8qx3PGN3ro2TRNvBht+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)