UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1pwnrnZWNitmMq6HhGPD/rMxlOk4/dPxoiCIEcmZSt4='
WHERE
key_id = '25198ce3e3a2baede71e895ae04105c3942f21041e0047e02b814cf7ff6de70e'
AND (
token = '1pwnrnZWNitmMq6HhGPD/rMxlOk4/dPxoiCIEcmZSt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)