UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pa2ycSEWfbD4UqSluKJstX8H+XB0JSy7jxslbfr/vCo='
WHERE
key_id = '71542f6e57c4bb690ef0230ec5a9a4a8fe2a4d229c9ba7ef149489469d60b3de'
AND (
token = 'pa2ycSEWfbD4UqSluKJstX8H+XB0JSy7jxslbfr/vCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)