UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GB8dShbCVDd70cE73rSaYwlNIxPVLl2isBXW9ZuUO3o='
WHERE
key_id = '601b9dad40922f5e01c9a47c2763421178f9a8b34be39a2c275ad91ed56c1c1c'
AND (
token = 'GB8dShbCVDd70cE73rSaYwlNIxPVLl2isBXW9ZuUO3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)