UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rud3O4XXxeC7z2caM9YFuQytE2xAb4C2m/oft5hbvSY='
WHERE
key_id = '0bf9647eaed64f55b1e80a952c3442a39a29a9eb7412f9393ad70b09c19e14a6'
AND (
token = 'Rud3O4XXxeC7z2caM9YFuQytE2xAb4C2m/oft5hbvSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)