UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i96q4Hjd5eFru0Rj5TWUAhSD75PE6fWrkaQEzLaWsaI='
WHERE
key_id = 'd8f296fb63492c0e8dfe8eec266f911ef410420284b9c424cdd98cae034bfcfd'
AND (
token = 'i96q4Hjd5eFru0Rj5TWUAhSD75PE6fWrkaQEzLaWsaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)