UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JJQZaA//JGHHXujYsWJojH72ndbPrgCXl28Yz1JhpDY='
WHERE
key_id = '3900df56671be6e33f0091f996612ec180dea1aee46ad365e65953c4b273b468'
AND (
token = 'JJQZaA//JGHHXujYsWJojH72ndbPrgCXl28Yz1JhpDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)