UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wb24S8+o5rDmephllsWxSm5U5xDoI7pbZQrGL1XZPNU='
WHERE
key_id = 'f26175f768e107cd881f27a28650dbb359d49d1f7e2245af705b6a008be734b8'
AND (
token = 'Wb24S8+o5rDmephllsWxSm5U5xDoI7pbZQrGL1XZPNU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)