UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ReQSuA7zJZB2uoXpWaq8tgDuoSCoK1jPebypBd/2FHg='
WHERE
key_id = '97ab192ab9a274a20ab590866f06edbe66cef84b35842e0293d87a2f7a9c7192'
AND (
token = 'ReQSuA7zJZB2uoXpWaq8tgDuoSCoK1jPebypBd/2FHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)