UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+tGnLNZ/s0KlbLd5SnXnWHNpuMB59JDGNpPeVZrYfms='
WHERE
key_id = '0b9746e9c6e9504c157ece95c016d767e7b1eef73b5d6bfad8ca77269c7090e2'
AND (
token = '+tGnLNZ/s0KlbLd5SnXnWHNpuMB59JDGNpPeVZrYfms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)