UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3sukYkiT2NXhBn6keEis2eM+XmzUXuhJp2kPebXicBk='
WHERE
key_id = 'e8bb9f3c7cadea9d8effd42111090457ec852c2ebc5afd00accd0e335ea23cbd'
AND (
token = '3sukYkiT2NXhBn6keEis2eM+XmzUXuhJp2kPebXicBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)