UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Dzs2MtKZZy3OZTkqMQ16Es6u8pmO/fcO3T2C5Kncd0='
WHERE
key_id = 'ad92b8d92f154c62d6f31fe47d48bf584d1e6405427d7b323963b1b3e4a90b83'
AND (
token = '5Dzs2MtKZZy3OZTkqMQ16Es6u8pmO/fcO3T2C5Kncd0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)