UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bJvWMUOAe3chV/nZZjVjtoZ2KEH+v5pkLIvp9oYv2Vc='
WHERE
key_id = '6a17dac2676984061b43b00e4b934da36b75996a39b1ea83d2d146b972cd4f9c'
AND (
token = 'bJvWMUOAe3chV/nZZjVjtoZ2KEH+v5pkLIvp9oYv2Vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)